package com.ymatou.app.seller.testcase;

import java.util.Map;

import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.experimental.categories.Category;

import com.ymatou.app.seller.parameter.GetActivityListBySellerBean;
import com.ymatou.app.seller.service.GetActivityListBySellerCall;
import com.ymt.core.tool.Logger;
import com.ymt.utils.annotation.TestCase;
import com.ymt.utils.annotation.TestSuite;
import com.ymt.utils.tag.P1;
import com.ymttest.business.service.AuthCallService;

/**
 * 获取直播活动 FreeMaker Template自动生成代码
 */
@TestSuite
public class Ts_GetActivityListBySeller {
	private static GetActivityListBySellerBean getActivityListbean;
	private static GetActivityListBySellerCall getActivityListcall;

	@BeforeClass
	public static void setUp() {
		Logger.createResultFile("获取直播活动");
	}

	@Before
	public void caseUp() {
		getActivityListbean = new GetActivityListBySellerBean();
		getActivityListcall = new GetActivityListBySellerCall();
	}

	@AfterClass
	public static void tearDown() {
		Logger.generateResult(getActivityListcall.getOpurl());
	}

	@After
	public void caseDown() {
		Logger.end();
	}

	@Test
	@Category(P1.class)
	@TestCase
	public void Tc_GetActivityListBySeller_001() {
		Logger.start(true,"获取直播活动成功");
		try {
			
			Map m = AuthCallService.authLogin("ukseller", "aabbcc");
			String AccessToken = (String) m.get("AccessToken");
//			int UserId = 20565820;
			// 设置参数
			getActivityListbean.setAccessToken(AccessToken);
			// 发送数据
			getActivityListcall.setData(getActivityListbean);
			getActivityListcall.callService();	
			Logger.comment("getActivityListcall send:" + getActivityListcall.getEntityString());
			Logger.comment("getActivityListcall response:" + getActivityListcall.getReturnData());
			Logger.comment("getLastActivityStatus:" + getActivityListcall.getLastActivityStatus());
			Logger.comment("getLastActivityId:" + getActivityListcall.getLastActivityId());
		} catch (Exception e) {
			Logger.fail(e);
		}
	}
}